/***************************************************************************
                          menu.h  -  Part of gltris
                             -------------------
    begin                : April 2001
    copyright            : (C) 2001 by David Delbecq (Alias Tchize)
    email                : david.delbecq@usa.net
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

/****************************************************************************
* See associated .c file for functions description.                         *
****************************************************************************/
#ifndef _menu_h_
#define _menu_h_
#define KEY_NORMAL_MASK 0x1000
#define KEY_SPECIAL_MASK 0x2000
/* Type used to identify */
/* 这个地方用来标识菜单上的每个区域的类型 */
#define MENU_TITLE 1
             /* Can't be selected */
#define MENU_LINK 2
             /* Link to another menu item */
#define MENU_EXIT 3
             /* Exit from the menu (return to higher level one if exists*/
#define MENU_KEY 4
            /* Place where to change a keybinding */
#define MENU_TEXT 5
            /* Place where to change a string */
#define MENU_RETURNSTATUS 6
            /* Exit the menu and give data to callback */
#define MENU_BOOLEAN 7
typedef struct
        {
        int entrytype;//类型
        char* text;//显示文字
        void * data; /*an integer for the key or a pointer to a string or a pointer to a submenulist etc. depend on entrytype*/
        int isusable;//是否可用
        }Tmenuentry;

typedef struct structmenulist //菜单列表
        {
        int activeitem;//菜单项激活
        int itemscount;//菜单项个数
        struct structmenulist* previousmenu;  /* 前一菜单项，当用户按下返回键时，则显示前一菜单 */
        Tmenuentry* menuentries;//菜单项
        }Tmenulist, *menuobj;



void setMenu (menuobj menu,callback_int menufinished, callback_void display);
#endif /* _menu_h_ */
